package com.gdsdxy.bookshop.service;

import com.gdsdxy.bookshop.dao.BookMapper;
import com.gdsdxy.bookshop.dao.CategoryMapper;
import com.gdsdxy.bookshop.pojo.Book;
import com.gdsdxy.bookshop.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class CategoryService {
    @Autowired
    CategoryMapper categoryMapper;

    /**
     * 功能描述：往书籍表Category表中添加一条记录
     * author:罗静
     * @Param
     * @return 返回新增的主键Id
     */
    public Integer addCategory(Category category) {
        categoryMapper.insert(category);
        return category.getCategoryid();
    }


}
